#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWidget>
#include <QBoxLayout>
#include <QLabel>
#include <QTextEdit>
#include <QPushButton>
#include "rtmphandle.h"
#include "rtmpreceive.h"


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow, public IRtmpEvent, public IReceiveEvent
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    int initHandle();
    void OnReadVideo(QImage image);
    void OnReceiveVideo(QImage image);

private:
    void initControls();
    void ShowImage(QImage image);

public slots:
    void receiveData();
    void startConnect();

private:
    Ui::MainWindow *ui;
    RtmpHandle *rHandle;
    RtmpReceive *receive;
    QLabel *mLable;
    QLabel *rLable;
    QTextEdit *mTxt;
    QTextEdit *rTxt;
    QPushButton *conButton;
    QPushButton *startButton;
    bool isPushed;
};
#endif // MAINWINDOW_H
